﻿using System.Windows.Input;

using GalaSoft.MvvmLight.Command;

namespace Organizer.ViewModel
{
    using System;

    using Microsoft.Phone.Tasks;

    /// <summary>
    /// The organization view model.
    /// </summary>
    public class AboutPageViewModel : BaseViewModel
    {

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="OrganizationViewModel"/> class.
        /// </summary>
        public AboutPageViewModel()
        {
            this.MakeReviewCommand = new RelayCommand(this.MakeReview);
            this.WriteToDevelopersCommand = new RelayCommand(this.WriteToDevelopers);
            this.GoToFacebookCommand = new RelayCommand(this.GoToFacebook);
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets AddCommand.
        /// </summary>
        public ICommand MakeReviewCommand { get; set; }

        public ICommand WriteToDevelopersCommand { get; set; }

        public ICommand GoToFacebookCommand { get; set; }

        #endregion

        private void MakeReview()
        {
            var marketplaceReviewTask = new MarketplaceReviewTask();
            marketplaceReviewTask.Show();
        }

        private void WriteToDevelopers()
        {
            var emailcomposer = new EmailComposeTask { To = "sashakirichek@ukr.net", Subject = "Important: Organizer review" };
            emailcomposer.Show();
        }

        private void GoToFacebook()
        {
            var webBrowserTask = new WebBrowserTask { Uri = new Uri("https://www.facebook.com/EducationAssistant/", UriKind.Absolute) };
            webBrowserTask.Show();
        }
    }
}
